/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package suministros.ejb30.entity;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 *
 * @author Luis_Angel
 */
@Embeddable
public class DetalleOrdenPK implements Serializable {
    @Basic(optional = false)
    @Column(name = "nro_orden")
    private String nroOrden;
    @Basic(optional = false)
    @Column(name = "correlativo")
    private int correlativo;

    public DetalleOrdenPK() {
    }

    public DetalleOrdenPK(String nroOrden, int correlativo) {
        this.nroOrden = nroOrden;
        this.correlativo = correlativo;
    }

    public String getNroOrden() {
        return nroOrden;
    }

    public void setNroOrden(String nroOrden) {
        this.nroOrden = nroOrden;
    }

    public int getCorrelativo() {
        return correlativo;
    }

    public void setCorrelativo(int correlativo) {
        this.correlativo = correlativo;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (nroOrden != null ? nroOrden.hashCode() : 0);
        hash += (int) correlativo;
        return hash;
    }

    @Override
    public boolean equals(Object object) {

        if (!(object instanceof DetalleOrdenPK)) {
            return false;
        }
        DetalleOrdenPK other = (DetalleOrdenPK) object;
        if ((this.nroOrden == null && other.nroOrden != null) || (this.nroOrden != null && !this.nroOrden.equals(other.nroOrden))) {
            return false;
        }
        if (this.correlativo != other.correlativo) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "suministros.ejb30.entity.DetalleOrdenPK[nroOrden=" + nroOrden + ", correlativo=" + correlativo + "]";
    }

}
